<template>
	<view style="height: 500rpx;background-color: orange;" class="app-container">
		<z-table @scrollBottom="scrollBottom" :tableData="tableData" :columns="columns" :tableHeight ="tableHeight" titleTextAlign="left" ></z-table>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tableData:false,
				tableHeight:0,
				columns:[
					{
						title:"<span style=\"color:#075337\">序号</span>",
						key:'index',
						width:100
					},{
						title:"<span style=\"color:#075337\">名称</span>",
						key:'name',
						width:140
					},{
						title:"<span style=\"color:#075337\">测试列1</span>",
						key:'cas',
						width:140,
						formatNum:false
					},{
						title:"<span style=\"color:#075337\">列2</span>",
						key:'capacity',
						width:80
					},{
						title:"<span style=\"color:#075337\">列3</span>",
						key:'specsTotal',
						width:100
					},{
						title:"<span style=\"color:#075337\">列4</span>",
						key:'useage',
						width:150
					}
				],
			}
		},
		onLoad() {
			setTimeout(()=>{
				this.initData()
			},2000)
		},
		methods: {
			initData(){
				this.tableData = [{
					index:1,
					name:'123',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				},{
					index:1,
					name:'123',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				},{
					index:1,
					name:'123',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				},{
					index:1,
					name:'123',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				},{
					index:1,
					name:'123',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				},{
					index:1,
					name:'我的名字有点长，你忍一下',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				},{
					index:1,
					name:'123',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				},{
					index:1,
					name:'123',
					cas:'12312312',
					capacity:'12',
					specsTotal:'2020',
					useage:'12'
				}]
			},
			scrollBottom(){
				console.log('真的触底了');
			}
		},
		
	}
</script>

<style lang="scss">

</style>
